package com.gsafety.wellsfort.domain.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

@Data
public class IndexWorkVO implements Comparable<IndexWorkVO> {
    @ApiModelProperty(value = "作业id")
    private Integer id;
    @ApiModelProperty(value = "作业发布id")
    private Integer workPublishId;
    @ApiModelProperty(value = "作业标题")
    private String workTitle;
    @ApiModelProperty(value = "课程id")
    private String courseId;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "发布时间")
    private Date publishTime;
    @ApiModelProperty(value = "讲师名称")
    private String teacherName;

    @Override
    public int compareTo(IndexWorkVO o) {
        if (this.publishTime == null || o.getPublishTime() == null) {
            return 0;
        }
        return this.publishTime.compareTo(o.getPublishTime());
    }
}
